/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航栏 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #e74c3c;
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.cart-btn {
    position: relative;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cart-btn:hover {
    background-color: #c0392b;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #2980b9;
}

/* 产品容器 */
.product-container {
    padding: 40px 0;
}

/* 产品展示区域 */
.product-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    gap: 40px;
}

/* 产品图片轮播 */
.product-gallery {
    flex: 1;
}

.main-image-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
}

.slides-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide-image.active {
    opacity: 1;
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 10;
}

.slide-btn:hover {
    background-color: white;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.slide-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: white;
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #e74c3c;
}

/* 产品信息 */
.product-info {
    flex: 1;
}

.product-title {
    font-size: 28px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.stars {
    color: #f39c12;
    font-size: 20px;
}

.rating-count {
    color: #7f8c8d;
    font-size: 14px;
}

.product-price {
    font-size: 32px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

.product-discount {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 20px;
}

.product-description {
    color: #555;
    margin-bottom: 30px;
    line-height: 1.8;
}

/* 产品选项 */
.product-options {
    margin-bottom: 20px;
}

.product-options h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.color-options {
    display: flex;
    gap: 10px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.3s;
}

.color-option.active {
    border-color: #e74c3c;
}

.size-options {
    display: flex;
    gap: 10px;
}

.size-option {
    width: 50px;
    height: 50px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.size-option:hover,
.size-option.active {
    border-color: #e74c3c;
    color: #e74c3c;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background-color: #f5f5f5;
}

.quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* 购买按钮 */
.purchase-actions {
    display: flex;
    gap: 20px;
    margin: 30px 0;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.primary-btn {
    background-color: #e74c3c;
    color: white;
}

.primary-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.secondary-btn {
    background-color: #3498db;
    color: white;
}

.secondary-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* 产品特色 */
.product-features {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
}

.feature-icon {
    font-size: 20px;
}

/* 用户评价区域 */
.reviews-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 24px;
    color: #2c3e50;
}

.review-sort {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    transition: box-shadow 0.3s;
}

.review-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.reviewer-name {
    font-weight: 500;
    color: #2c3e50;
}

.review-rating {
    color: #f39c12;
}

.review-date {
    color: #7f8c8d;
    font-size: 14px;
}

.review-content {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.review-images {
    display: flex;
    gap: 10px;
}

.review-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.load-more-btn {
    margin-top: 20px;
    padding: 12px 30px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    width: 100%;
}

.load-more-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* 购物车侧边栏 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 20px;
    color: #2c3e50;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-cart:hover {
    background-color: #f5f5f5;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.cart-item-options {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #e74c3c;
    font-weight: 500;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    margin-top: 5px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.cart-total {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: right;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.checkout-btn:hover {
    background-color: #c0392b;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.cart-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 100px;
    right: -400px;
    background-color: #2ecc71;
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 300;
    transition: right 0.3s ease;
}

.notification.show {
    right: 20px;
}

.notification.error {
    background-color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 15px;
    }
    
    .product-section {
        flex-direction: column;
    }
    
    .main-image-container {
        height: 300px;
    }
    
    .purchase-actions {
        flex-direction: column;
    }
    
    .product-features {
        flex-direction: column;
        gap: 15px;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-item,
.cart-item {
    animation: fadeIn 0.3s ease;
}